/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Caps
 */
@Entity
@Table(name = "setor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Setor.findAll", query = "SELECT s FROM Setor s"),
    @NamedQuery(name = "Setor.findByStrCodigo", query = "SELECT s FROM Setor s WHERE s.strCodigo = :strCodigo"),
    @NamedQuery(name = "Setor.findByStrDescricao", query = "SELECT s FROM Setor s WHERE s.strDescricao = :strDescricao"),
    @NamedQuery(name = "Setor.findByTblgrl", query = "SELECT s FROM Setor s WHERE s.tblgrl = :tblgrl")})
public class Setor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "str_codigo")
    private String strCodigo;
    @Size(max = 2147483647)
    @Column(name = "str_descricao")
    private String strDescricao;
    @Size(max = 45)
    @Column(name = "tblgrl")
    private String tblgrl;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "setor")
    private List<DiretorCentro> diretorCentroList;
    @OneToMany(mappedBy = "strCodigo")
    private List<Disciplina> disciplinaList;
    @OneToMany(mappedBy = "strColegiado")
    private List<Curso> cursoList;
    @OneToMany(mappedBy = "strResponsavel")
    private List<Curso> cursoList1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "strLotacao")
    private List<Docente> docenteList;

    public Setor() {
    }

    public Setor(String strCodigo) {
        this.strCodigo = strCodigo;
    }

    public String getStrCodigo() {
        return strCodigo;
    }

    public void setStrCodigo(String strCodigo) {
        this.strCodigo = strCodigo;
    }

    public String getStrDescricao() {
        return strDescricao;
    }

    public void setStrDescricao(String strDescricao) {
        this.strDescricao = strDescricao;
    }

    public String getTblgrl() {
        return tblgrl;
    }

    public void setTblgrl(String tblgrl) {
        this.tblgrl = tblgrl;
    }

    @XmlTransient
    public List<DiretorCentro> getDiretorCentroList() {
        return diretorCentroList;
    }

    public void setDiretorCentroList(List<DiretorCentro> diretorCentroList) {
        this.diretorCentroList = diretorCentroList;
    }

    @XmlTransient
    public List<Disciplina> getDisciplinaList() {
        return disciplinaList;
    }

    public void setDisciplinaList(List<Disciplina> disciplinaList) {
        this.disciplinaList = disciplinaList;
    }

    @XmlTransient
    public List<Curso> getCursoList() {
        return cursoList;
    }

    public void setCursoList(List<Curso> cursoList) {
        this.cursoList = cursoList;
    }

    @XmlTransient
    public List<Curso> getCursoList1() {
        return cursoList1;
    }

    public void setCursoList1(List<Curso> cursoList1) {
        this.cursoList1 = cursoList1;
    }

    @XmlTransient
    public List<Docente> getDocenteList() {
        return docenteList;
    }

    public void setDocenteList(List<Docente> docenteList) {
        this.docenteList = docenteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (strCodigo != null ? strCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Setor)) {
            return false;
        }
        Setor other = (Setor) object;
        if ((this.strCodigo == null && other.strCodigo != null) || (this.strCodigo != null && !this.strCodigo.equals(other.strCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Setor[ strCodigo=" + strCodigo + " ]";
    }
    
}
